<template>
  <a-badge :status="state" :text="MarketingState.getDesc(marketingState)" />
</template>
<script>
  import { defineComponent } from 'vue';
  import { MarketingState } from '@/enums/biz/marketingState';

  export default defineComponent({
    name: 'MarketingStateTag',
    props: {
      marketingState: {
        type: Number,
        required: true,
      },
    },
    setup() {
      return {
        MarketingState,
      };
    },
    computed: {
      state() {
        if (this.marketingState === 2) {
          return 'warning';
        } else if (this.marketingState === 3) {
          return 'success';
        } else {
          return 'processing';
        }
      },
    },
  });
</script>
